import { Body, Controller, Get, Post, Res } from "@nestjs/common"
import { ProgramService } from "./program.service"
import { Response } from "express"

@Controller("/program")
export class ProgramController {
  constructor(private readonly programService: ProgramService) {}

  // Add application
  @Post("/add")
  async add(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.add(body, res)
  }

  // Obtain all application information
  @Get("/getAll")
  async getAll(@Res() res: Response): Promise<void> {
    return await this.programService.getAll(res)
  }

  // Obtain all application information with soft deletion
  @Get("/getAllWidthDeleted")
  async getAllWidthDeleted(@Res() res: Response): Promise<void> {
    return await this.programService.getAllWidthDeleted(res)
  }

  // Update application status
  @Post("/updateStatus")
  async updateStatus(
    @Body() body: object,
    @Res() res: Response
  ): Promise<void> {
    return await this.programService.updateStatus(body, res)
  }

  // Search application information
  @Post("/search")
  async search(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.search(body, res)
  }

  // Search application information with soft deletion
  @Post("/searchWidthDeleted")
  async searchWidthDeleted(
    @Body() body: object,
    @Res() res: object
  ): Promise<void> {
    return await this.programService.searchWidthDeleted(body, res)
  }

  // Update application information
  @Post("/update")
  async update(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.update(body, res)
  }

  // Soft deletion application
  @Post("/delete")
  async delete(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.delete(body, res)
  }

  // Real deletion application
  @Post("/remove")
  async remove(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.remove(body, res)
  }

  // Restore application information
  @Post("/restore")
  async restore(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.restore(body, res)
  }

  // Batch soft deletion application information
  @Post("/deleteGroup")
  async deleteGroup(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.deleteGroup(body, res)
  }

  // Batch real deletion application information
  @Post("/removeGroup")
  async removeGroup(@Body() body: object, @Res() res: Response): Promise<void> {
    return await this.programService.removeGroup(body, res)
  }

  // Obtain application name lists
  @Get("/getNameLists")
  async getNameLists(@Res() res: Response): Promise<void> {
    return await this.programService.getNameLists(res)
  }

  // Obtain application number
  @Get("/count")
  async count(@Res() res: Response): Promise<void> {
    await this.programService.count(res)
  }
}
